﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Collections;
using System.Windows.Shapes;
using System.Windows;

namespace LaTeXGrapher
{
    public class PointData
    {
        KeyValuePair<string, string>[] _points;

        public static PointData Create(IEnumerable<KeyValuePair<string, string>> points)
        {
            return new PointData(points);
        }

        private PointData(IEnumerable<KeyValuePair<string, string>> points)
        {
            _points = points.ToArray();
        }

        public IEnumerable<Point> GetPoints(FunctionContext context)
        {
            return _points.Select(p => new Point(
                context.Evaluate(p.Key),
                context.Evaluate(p.Value)));
        }
    }
}
